if (window.location.href.indexOf("message") > 0) {
  window.location.href = "<%= activities_path %>";
} else {
  controllerName = $("body").data("controller");
  controllerAction = $("body").data("action");

  $("#content").prepend("<%= escape_javascript(render "socializer/shared/flash") %>");
  $("<% flash.discard %>")

  $(".activities").prepend("<%= escape_javascript(render activity) %>");
  $("[data-behavior~=new-note-form]").replaceWith("<%= escape_javascript(render "socializer/notes/form", note: note, title: title, current_id: current_id) %>");

  setup(controllerName, controllerAction);
  addTimeAgoSupport();
  addTooltipSupport( $(".tooltip", ".activities") );
}
